<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.cpfmat.common.Contains,com.cpfmat.entity.ContentUser"%>
<%@ include file="/WEB-INF/jsp/common.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/WEB-INF/jsp/importHead.jsp"%>
<%@ include file="/WEB-INF/jsp/importCommonCss.jsp"%>
<link rel="stylesheet" type="text/css" href="${basePath }/css/index-old.css" />
<style>
.upload-img{position: relative;overflow: hidden;}
.upload-img input[type=file]{
	position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    width: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 50rem;
   }
.show_met_16_1 .nav {
	border: 1px solid #e4eaec;
}
.show_met_16_1 .nav .nav-link{
	color: #62a8ea;
	border-top-left-radius: unset;
	border-top-right-radius: unset;
}

.show_met_16_1 .nav .nav-link.active{
	color: #FFF;
    background-color: #0075c1;
}

.show_met_16_1 .nav .nav-tabs .nav-link:focus, .nav-tabs .nav-link:hover{
	color: #FFF;
    background-color: #0075c1;
}

.custom-nav{
	width: 160px;
	float: left;
}

.custom-content{
	width: calc(100% - 180px);
	margin-left: 20px;
	float: left;
}

.breadcrumb {
  padding: 8px 15px;
  margin: 0 0 20px;
  list-style: none;
}
.breadcrumb li {
  display: inline-block;
  *display: inline;
  /* IE7 inline-block hack */

  *zoom: 1;
  text-shadow: 0 1px 0 #ffffff;
}
.breadcrumb .divider {
  padding: 0 5px;
  color: #ccc;
}
.breadcrumb .active {
  color: #999999;
}
.red{
	color: red;
}
.bgcolor{
	background-color: #fff;
}

pre.pre-wrap{
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}
</style>
</head>

<body class="met-navfixed">
	<%@ include file="/WEB-INF/jsp/importHeader.jsp"%>

	<main class="show_met_16_1 met-show-body panel panel-body m-b-0" style="background-color: #F5F5F5;border-top: solid 2px #4ca8d8;">
		<div class="container">
			<ul class="breadcrumb" style="margin-bottom: 5px;">
		      <li><a href="${basePath }">首页</a><span class="divider">></span></li>
		      <li class="active">个人中心</li>
		  	</ul>
		  	
		  	<div class="col-xs-12">
				<div class="custom-nav bgcolor">
				    <ul class="nav nav-list" style="height: 200px;">
				      <c:if test="${onlyCollection ne true or onlyCollection ne 'true'}">				   
				      <li class="nav-item nav-tabs"><a class="nav-link text-xs-center p-t-1" href="${basePath }/personalCenter">个人设置</a></li>
				      <li class="nav-item nav-tabs"><a class="nav-link text-xs-center p-t-1" href="${basePath }/changePwd">密码修改</a></li>
				      </c:if>
				      <li class="nav-item nav-tabs"><a class="nav-link text-xs-center p-t-1 active" href="${basePath }/sendAtri?pageNum=1&onlyCollection=${onlyCollection}">材料报送</a></li>
				    </ul>
			    </div>
			    
			    <div class="custom-content bgcolor" style="min-height: 400px;border: 1px #dcdcdc solid;padding: 20px;">
			    	<form action="${basePath }/sendAtri?pageNum=${pageNum}&onlyCollection=${onlyCollection}" method="post" id="changeInfoForm" class="form-horizontal container">
			    		<div class="container-fluid form-group" style="border-bottom: 1px #dcdcdc dashed;padding-bottom: 10px;margin-bottom: 20px;">
							<label class="col-xs-12 form-control-label text-xs-left">
								<h4>材料报送详情</h4>
							</label>
						</div>
						
						<div class="container-fluid form-group">
							<label class="col-xs-2 form-control-label text-xs-left">
								报送事项：
							</label>
							<div class="col-xs-10">
								<div class="col-xs-12 p-a-0">
									<pre class="pre-wrap">${content.submission }</pre>
								</div>
							</div>
						</div>
						
						<div class="container-fluid form-group">
							<label class="col-xs-2 form-control-label text-xs-left">
								报送单位：
							</label>
							<div class="col-xs-10">
								<div class="col-xs-12 p-a-0">
									<pre class="pre-wrap">${content.unit }</pre>
								</div>
							</div>
						</div>
						
						<div class="container-fluid form-group">
							<label class="col-xs-2 form-control-label text-xs-left">
								联系人：
							</label>
							<div class="col-xs-10">
								<div class="col-xs-12 p-a-0">
									<pre class="pre-wrap">${content.contactPerson }</pre>
								</div>
							</div>
						</div>
						
						<div class="container-fluid form-group">
							<label class="col-xs-2 form-control-label text-xs-left">
								联系电话：
							</label>
							<div class="col-xs-10">
								<div class="col-xs-12 p-a-0">
									<pre class="pre-wrap">${content.contactPhone }</pre>
								</div>
							</div>
						</div>
						
						<div class="container-fluid form-group">
							<label class="col-xs-2 form-control-label text-xs-left">
								技术成果名称：
							</label>
							<div class="col-xs-10">
								<div class="col-xs-12 p-a-0">
									<pre class="pre-wrap">${content.title }</pre>
								</div>
							</div>
						</div>
						
						<%-- <div class="container-fluid form-group">
							<label class="col-xs-2 form-control-label text-xs-left">
								技术成果简介：
							</label>
							<div class="col-xs-10">
								<div class="col-xs-12 p-a-0">
									<pre class="pre-wrap">${content.subTitle }</pre>
								</div>
							</div>
						</div> --%>
						
						<div class="container-fluid form-group">
							<label class="col-xs-2 form-control-label text-xs-left">
								技术成熟度：
							</label>
							<div class="col-xs-10">
								<div class="col-xs-12 p-a-0">
									<pre class="pre-wrap">${content.tecExp }</pre>
								</div>
							</div>
						</div>
						
						<div class="container-fluid form-group">
							<label class="col-xs-2 form-control-label text-xs-left">
								专项领域：
							</label>
							<div class="col-xs-4">
								<pre class="pre-wrap"><%
									ContentUser content = (ContentUser) request.getAttribute("content");
									if(content != null && content.getSpecialField() != null){
										out.print(Contains.specialFieldMap.get(content.getSpecialField()));
									}
									else{
										out.print("其他");
									}
								%></pre>
							</div>
						</div>
		
						<div class="container-fluid form-group">
							<label class="col-xs-2 form-control-label text-xs-left">
								技术成果简介：
							</label>
							<div class="col-xs-10">
								<div class="col-xs-12 p-a-0">
									<pre class="pre-wrap">${content.content}</pre>
								</div>
							</div>
						</div>
						
						<c:if test="${(content.shzt eq 'N' or content.shzt eq 'n') and !empty content.finalRejection}">
						<div class="container-fluid form-group">
							<label class="col-xs-2 form-control-label text-xs-left">
								审核不通过原因：
							</label>
							<div class="col-xs-10">
								<div class="col-xs-12 p-a-0 red">
									<pre class="pre-wrap">${content.finalRejection }</pre>
								</div>
							</div>
						</div>
						</c:if>
						
						<div class="container-fluid form-group">
							<label class="col-xs-2 form-control-label text-xs-left">
								附件：
							</label>
							<div class="col-xs-10">
								<div class="col-xs-12 p-a-0">
									<div id="downLoadDiv" class="clearfix p-t-1">
										<c:if test="${!empty attachments}">
											<c:forEach items="${attachments }" var="attachment">
												<div class="col-xs-9 pull-left m-b-1 p-a-0">
													<button type="button" onclick="downloadAttachment('${attachment.filePath }','${attachment.fileName }')" title="${attachment.fileName }"
														class="btn btn-default btn-sm">
														<c:choose>
															<c:when test="${fn:length(attachment.fileName) > 20}">
																<c:set var="fileName"
																	value="${fn:substring(attachment.fileName, 0, 20)}..." />
															</c:when>
															<c:otherwise>
																<c:set var="fileName" value="${attachment.fileName}" />
															</c:otherwise>
														</c:choose>
														<i class="icon wb-download" style="max-width: 200px;"></i>${fileName}
													</button>
												</div>
											</c:forEach>
										</c:if>
									</div>
								</div>
							</div>
						</div>
						
						<div class="form-group text-xs-center">
							<button class="btn btn-primary" type="submit">返回</button>		
						</div>
					</form>
			    </div>
		    </div>
		</div>
	</main>


	<%@ include file="/WEB-INF/jsp/importFooter.jsp"%>
	<%@ include file="/WEB-INF/jsp/importCommonJS.jsp"%>
	<script type="text/javascript">
		function downloadAttachment(fileUrl,fileName){
			var form = document.createElement("form");
			form.action = "${basePath}/downloadAttachments";
			form.method = "post";
			form.target = "_blank";
			form.style.display = "none";
			var input = document.createElement("input");
			var input1 = document.createElement("input");
			input.name = "url";
			input.type = "hidden";
			input.value = fileUrl;
			input1.name = "fileName";
			input1.type = "hidden";
			input1.value = fileName;
			
			form.appendChild(input);
			form.appendChild(input1);
			
			document.body.appendChild(form);
			
			form.submit();
			document.body.removeChild(form);
		}
	</script>
</body>
</html>